package cn.pn.project.mapper.commodity;

import cn.pn.project.pojo.commodity.Sku;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

@Mapper
public interface SkuDao {

    /**
     * 根据商品id查询场次id
     * @param commdityId
     * @return
     * @throws SQLException
     */
    public List<Sku> getSkuByCommdityId(@Param("commdityId")Integer commdityId) throws SQLException;


    /**
     * 根据场次id和商品id查询skuid
     * @param commdityId 商品id
     * @param sessionId 场次id
     * @return
     * @throws SQLException
     */
    public List<Sku> getSkuByCommdityIdAndSessionId(@Param("commdityId")Integer commdityId,@Param("sessionId") Integer sessionId) throws SQLException;


    /**
     * 多条件查询SKU对象（谢耀翔）
     * @param param
     * @return
     * @throws Exception
     */
    public Sku getSkuByMap(Map<String,Object> param)throws Exception;

    /**
     * 多条件查询SKU集合（谢耀翔）
     * @param param
     * @return
     * @throws Exception
     */
    public List<Sku> getSkuListByMap(Map<String,Object> param)throws Exception;

    /**
     *
     * -----------------------------------常辉辉
     * 根据商品id，场次id，票档id查询出价格
     * @param commdityId
     * @param sessionId
     * @param ticketFileId
     * @return
     */
    public Sku getPrice(@Param("commdityId") Integer commdityId,@Param("sessionId") Integer sessionId,@Param("ticketFileId") Integer ticketFileId) throws  SQLException;


}
